/* 
 * CMPS 258: Programming Languages
 *        Assignment 2 - Part2: "Spy" - March 24, 2008
 *        Group name: Doomsday
 *        Authors:  Ramsey Nasser (ID# 200600496) 
 *                  Hadi Abu Rislan (ID# 200600426) 
 *                  Kevin Azzam (ID# 200602033)
 * 
 * Function to exit, leaving a message.
 * 
 * This function was adapted from example code provided in CMPS 297H.
 */

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/*------------------------------------------------------------------------
 * errexit - print an error message and exit
 *------------------------------------------------------------------------
 */
int
errexit(const char *format, ...)
{
	char f[1024];
	va_list	args;

	va_start(args, format);
	sprintf(f,"\n%s\n",format);
	vfprintf(stderr, f, args);
	va_end(args);
	exit(1);
}
